<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">
<title>我的收藏</title>
<link href="../static/css/admin.css" rel="stylesheet" type="text/css">
<link href="../static/css/amazeui.css" rel="stylesheet" type="text/css">
<link href="../static/css/personal.css" rel="stylesheet" type="text/css">
<link href="../static/css/colstyle.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery-2.0.0.min.js"></script>
<script src="../static/js/amazeui.js"></script>
<script src="../static/js/myinit.js"></script>
</head>

<body>
<!--头 -->
<header>
  <article>
    <div class="mt-logo"> 
      <!--顶部导航条 -->
      <div class="am-container header">
        <ul class="message-l">
          <div class="topMessage">
            <div class="menu-hd"> <a href="#" target="_top" class="h">亲，请登录</a> <a href="#" target="_top">免费注册</a> </div>
          </div>
        </ul>
        <ul class="message-r">
          <div class="topMessage home">
            <div class="menu-hd"><a href="#" target="_top" class="h">商城首页</a></div>
          </div>
          <div class="topMessage my-shangcheng">
            <div class="menu-hd MyShangcheng"><a href="#" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
          </div>
          <div class="topMessage mini-cart">
            <div class="menu-hd"><a id="mc-menu-hd" href="#" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
          </div>
          <div class="topMessage favorite">
            <div class="menu-hd"><a href="#" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a></div>
          </div>
        </ul>
      </div>
      
      <!--悬浮搜索框-->
      
      <div class="nav white">
        <div class="logoBig">
          <li><img src="../static/img/logobig.png" /></li>
        </div>
        <div class="search-bar pr"> <a name="index_none_header_sysc" href="#"></a>
          <form>
            <input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off">
            <input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
          </form>
        </div>
      </div>
      <div class="clear"></div>
    </div>
    </div>
  </article>
</header>
<div class="nav-table">
  <div class="long-title"><span class="all-goods">全部分类</span></div>
  <div class="nav-cont">
    <ul>
      <li class="index"><a href="#">首页</a></li>
      <li class="qc"><a href="#">闪购</a></li>
      <li class="qc"><a href="#">限时抢</a></li>
      <li class="qc"><a href="#">团购</a></li>
      <li class="qc last"><a href="#">大包装</a></li>
    </ul>
    <div class="nav-extra"> <i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>我的优惠券<i class="am-icon-angle-right" style="padding-left: 10px;"></i> </div>
  </div>
</div>
<b class="line"></b>
<div class="center">
  <div class="col-main">
    <div class="main-wrap">
      <div class="user-collection"> 
        <!--标题 -->
        <div class="am-cf am-padding">
          <div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">我的收藏</strong> / <small>My&nbsp;Collection</small></div>
        </div>
        <hr/>
        <div class="you-like">
          <div class="s-content"  id="sousuojieguo">

          </div>
          <div class="s-more-btn i-load-more-item" data-screen="0"><i class="am-icon-refresh am-icon-fw"></i>更多</div>
        </div>
      </div>
    </div>
    <!--底部-->
    <div class="footer ">
      <div class="footer-hd">
        <p><img src="../static/img/duo.png" style="width:25px" />品类齐全<b>|</b><img src="../static/img/kuai.png" style="width:25px" />多仓直发<b>|</b><img src="../static/img/hao.png" style="width:25px" />正品行货<b>|</b><img src="../static/img/sheng.png" style="width:25px" />天天低价</p>
      </div>
      <div class="footer-bd "> </div>
    </div>
  </div>
  <aside class="menu">
    <ul>
      <li class="person active"> <a>个人中心</a> </li>
      <li class="person"  id="tomyorders"> <a href="#">我的订单</a> </li>
      <li class="person"> <a href="#" id="wodeshoucang">我的收藏</a> </li>
      <li class="person"> <a href="#" id="chengweihuiyuan">成为会员</a> </li>
      <li class="person"> <a href="#" id="youhuiquan">优惠卡券</a> </li>
      <li class="person"> <a href="#" id="xianjinzhanghu">我的充值</a> </li>
      <li class="person"> <a href="#" id="shouhuodizhi">收货地址</a> </li>
    </ul>
  </aside>
</div>
<script type="text/javascript">
	var openid= getUrldata('OPENID');
	$.ajaxSettings.async = false;

	$('#youhuiquan').click(function(e) {
		document.location.href="coupon_pc.html?OPENID="+openid;
	});

	$('#tomyorders').click(function(){
		window.location.href="order_pc.html?code="+code;
	});
	
	$('#shouhuodizhi').click(function(){
		document.location.href="address_pc.html?OPENID="+openid;

	});
	$('#xianjinzhanghu').click(function(){
		document.location.href="bonus_pc.html?OPENID="+openid;
	});

	
	$('#chengweihuiyuan').click(function(e) {
        document.location.href="register_pc.html?OPENID="+openid;
    });
	$('#wodeshoucang').click(function(e){
		document.location.href="collection_pc.html?OPENID="+openid;
	});

	 

	
	$('#to_top').click(function(){
		$('html,body').animate({scrollTop: '0px'}, 800);
	});

	/***************本页逻辑开始********************/
	
	$(document).ready(function(){
		shoucang();
	});
	function shoucang(){
		var url = "/webserver/api/v1/userfavorite/?format=json&openid="+openid;
		var ww=$(document).innerWidth();
		$.getJSON(url,function(rs){
			console.log(rs);
			var objects = rs.objects;
			if(objects.length!=0){
				$('#sousuojieguo').empty();
				$.each(objects,function(index,item){
					$('#sousuojieguo').append('<div class="s-item-wrap"><div class="s-item"><div class="s-pic"  onclick="toUrl(\'xiangqing.html?GOODID='+item.goods.id+'&OPENID='+openid+'\')"> <a href="#" class="s-pic-link"> <img src="'+item.goods.image_thumb+'" class="s-pic-img s-guess-item-img"> </a> </div><div class="s-info"  onclick="toUrl(\'xiangqing.html?GOODID='+item.goods.id+'&OPENID='+openid+'\')"><div class="s-title"  onclick="toUrl(\'xiangqing.html?GOODID='+item.goods.id+'&OPENID='+openid+'\')"><a href="#">'+item.goods.name+'</a></div> <div class="s-price-box"  onclick="toUrl(\'xiangqing.html?GOODID='+item.goods.id+'&OPENID='+openid+'\')"> <span class="s-price"><em class="s-price-sign">¥</em><em class="s-value">'+item.goods.price+'</em></span></div></div> <div class="s-tp"><p> <a href="javascript:;" class="c-nodo J_delFav_btn">取消收藏</a> </p></div></div></div>');
				});
				
			}
			$('#sousuojieguo').show();
		},'json');
		
		$.getJSON(url,function(rs){
			var objects = rs.objects;
		});
	}
	</script>
</body>
</html>